<script type="text/javascript">
    $(document).ready(function() { 
        $('#barang_nilai_upgrade').autoNumeric({
            aSep: '.', aDec: ',', vMax: "999999999999999", vMin: "0"
        }); 
        
        $('#barang_nilai_total').autoNumeric({
            aSep: '.', aDec: ',', vMax: "999999999999999", vMin: "0"
        });   
    });
</script>
<script language="javascript" type="text/javascript">
    function confirm_action() {
        if (confirm("Apakah anda yakin akan memproses data ini?")) {
            return true;
        }
        return false;
    }
</script> 
<div class="breadcrum">
   <p>
       <a href="#">Inventarisasi</a>
       <span></span><a href="{$config->site_url('master/barang')}">Barang</a> 
       <span></span><small>Upgrade {$result.barang_nama|default:''} - {$result.barang_noinventaris|default:''}</small>
   </p>
   <div class="clear"></div>
</div> 
<div class="sub-nav-content">
    <ul>
        <li><a href="{$config->site_url('inventarisasi/pengadaan')}">Barang</a></li>      
        <li><a class="active" href="#">Upgrade Barang</a></li>       
    </ul>
    <div class="clear"></div> 
    <div class="sub-content">
        <div class="table-info-box">
            <h3>Upgrade Barang</h3>
            <table width="100%" class="table-info">
                <tr>
                    <th width="15%" valign="top">No Inventaris</th>
                    <td><b>{$result.barang_noinventaris|default:''}</b></td>
                </tr>
                <tr>
                    <th valign="top">Nama</th>
                    <td>{$result.barang_nama|default:''}</td>
                </tr>                
                <tr>
                    <th valign="top">Harga Perolehan</th>
                    <td>{$result.barang_harga_beli|default:'0'|number_format:0:",":"."}</td>
                </tr>
                <tr>
                    <th valign="top">Umur Ekonomis</th>
                    <td>{$result.barang_umurekonomis|default:''} Tahun</td>
                </tr>
                <tr>
                    <th valign="top">Tanggal Perolehan</th>
                    <td>{$dtm->get_full_date($result.barang_tglbeli|default:'')}</td>
                </tr>
                <tr>
                    <th valign="top">Tanggal Berakhir</th>
                    <td>{$dtm->get_full_date($result.barang_tglberakhir|default:'')}</td>
                </tr>
                <tr>
                    <th valign="top">Kondisi</th>
                    <td>{$result.barang_kondisi|default:''}</td>
                </tr>
                <tr>
                    <th valign="top">Status</th>
                    <td> 
                        {if $result.barang_status eq 'digunakan'}
                            DI GUNAKAN
                        {elseif $result.barang_status  eq 'digudang'}
                            DI GUDANG
                        {elseif $result.barang_status  eq 'disewakan'}
                            DI SEWAKAN
                        {elseif $result.barang_status  eq 'dipinjamkan'}
                            DI PINJAMKAN
                        {elseif $result.barang_status  eq 'service'}
                            SERVICE / MAINTENANCE
                        {/if} 
                    </td>
                </tr>
                <tr>
                    <th valign="top">Garansi</th>
                    <td>
                        {if $result.barang_garansi eq '1'}
                            YA, {$dtm->get_full_date($result.barang_tgl_garansi|default:'')}
                        {else}
                            TIDAK
                        {/if}
                    </td>
                </tr>
                <tr>
                    <th valign="top">Disusutkan</th>
                    <td>
                        {if $result.barang_susut eq '1'}
                            YA
                        {else}
                            TIDAK
                        {/if}
                    </td>
                </tr>
                <tr>
                    <th valign="top">Ruang</th>
                    <td>{$result.ruang_nomor|default:''}</td>
                </tr>
                <tr>
                    <th valign="top">Kategori</th>
                    <td>{$result.ruang_nomor|default:''}</td>
                </tr>
                <tr>
                    <th valign="top">Jenis</th>
                    <td>{$result.jenisbarang_name|default:''}</td>
                </tr>
                <tr>
                    <th valign="top">Merk</th>
                    <td>{$result.merk_name|default:''}</td>
                </tr>
                <tr>
                    <th valign="top">Vendor</th>
                    <td>{$result.vendor_name|default:''}</td>
                </tr>
                <tr>
                    <th valign="top">Keterangan</th>
                    <td>{$result.barang_keterangan|default:''}</td>
                </tr>
            </table>
        </div>
        <div class="clear"></div>
        <!-- notification template --> 
        {include file="base/templates/notification.html"}
        <!-- end of notification template-->
        <form method="post" action="{$config->site_url('master/barang/upgrade_proccess')}" enctype="multipart/form-data">
            <input type="hidden" size="50" maxlength="100" name="barang_id" id="barang_id" value="{$result.barang_id}"/>
            <table width="100%" class="table-input">
                <tbody>
                    <tr class="headrow">
                        <th colspan="2">Upgrade Barang</th>
                    </tr>
                    <tr>
                        <td>Nilai Buku</td>
                        <td>
                            <input type="hidden" id="barang_nilai_buku" name="barang_nilai_buku" value="{$result.barang_nilai_buku}" />
                            <b style="text-align: right;font-size:16pt;color: red;font-weight: bold;">{$result.barang_nilai_buku|number_format:0:",":"."}</b>
                        </td> 
                    </tr> 
                    <tr>
                        <td width="20%">Nilai Upgrade</td>
                        <td>  
                            <input style="text-align: right;font-size:16pt;color: red;font-weight: bold;" type="text" id="barang_nilai_upgrade" name="barang_nilai_upgrade" value="{$result.barang_nilai_upgrade}" />
                            <small>* wajib diisi</small>
                        </td> 
                    </tr> 
                    <tr class="submit-box">
                        <td colspan="3">
                            <input type="submit" class="edit-button" value="Simpan" name="save[insert]"> 
                        </td>
                    </tr>
                </tbody>
            </table> 
        </form>
    </div>
</div>